Optimal. Leaf size=127 \[ \frac {49 a^4 x}{16}+\frac {8 a^4 \sin (c+d x)}{d}+\frac {49 a^4 \cos (c+d x) \sin (c+d x)}{16 d}+\frac {41 a^4 \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {a^4 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {4 a^4 \sin ^3(c+d x)}{d}+\frac {4 a^4 \sin ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps
used = 15, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2836, 2715, 8,
2713} \begin {gather*} \frac {4 a^4 \sin ^5(c+d x)}{5 d}-\frac {4 a^4 \sin ^3(c+d x)}{d}+\frac {8 a^4 \sin (c+d x)}{d}+\frac {a^4 \sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac {41 a^4 \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac {49 a^4 \sin (c+d x) \cos (c+d x)}{16 d}+\frac {49 a^4 x}{16} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2836
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+a \cos (c+d x))^4 \, dx &=\int \left (a^4 \cos ^2(c+d x)+4 a^4 \cos ^3(c+d x)+6 a^4 \cos ^4(c+d x)+4 a^4 \cos ^5(c+d x)+a^4 \cos ^6(c+d x)\right ) \, dx\\ &=a^4 \int \cos ^2(c+d x) \, dx+a^4 \int \cos ^6(c+d x) \, dx+\left (4 a^4\right ) \int \cos ^3(c+d x) \, dx+\left (4 a^4\right ) \int \cos ^5(c+d x) \, dx+\left (6 a^4\right ) \int \cos ^4(c+d x) \, dx\\ &=\frac {a^4 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a^4 \cos ^3(c+d x) \sin (c+d x)}{2 d}+\frac {a^4 \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac {1}{2} a^4 \int 1 \, dx+\frac {1}{6} \left (5 a^4\right ) \int \cos ^4(c+d x) \, dx+\frac {1}{2} \left (9 a^4\right ) \int \cos ^2(c+d x) \, dx-\frac {\left (4 a^4\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac {\left (4 a^4\right ) \text {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {a^4 x}{2}+\frac {8 a^4 \sin (c+d x)}{d}+\frac {11 a^4 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {41 a^4 \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {a^4 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {4 a^4 \sin ^3(c+d x)}{d}+\frac {4 a^4 \sin ^5(c+d x)}{5 d}+\frac {1}{8} \left (5 a^4\right ) \int \cos ^2(c+d x) \, dx+\frac {1}{4} \left (9 a^4\right ) \int 1 \, dx\\ &=\frac {11 a^4 x}{4}+\frac {8 a^4 \sin (c+d x)}{d}+\frac {49 a^4 \cos (c+d x) \sin (c+d x)}{16 d}+\frac {41 a^4 \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {a^4 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {4 a^4 \sin ^3(c+d x)}{d}+\frac {4 a^4 \sin ^5(c+d x)}{5 d}+\frac {1}{16} \left (5 a^4\right ) \int 1 \, dx\\ &=\frac {49 a^4 x}{16}+\frac {8 a^4 \sin (c+d x)}{d}+\frac {49 a^4 \cos (c+d x) \sin (c+d x)}{16 d}+\frac {41 a^4 \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {a^4 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {4 a^4 \sin ^3(c+d x)}{d}+\frac {4 a^4 \sin ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.22, size = 73, normalized size = 0.57 \begin {gather*} \frac {a^4 (2940 d x+5280 \sin (c+d x)+1905 \sin (2 (c+d x))+720 \sin (3 (c+d x))+225 \sin (4 (c+d x))+48 \sin (5 (c+d x))+5 \sin (6 (c+d x)))}{960 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 169, normalized size = 1.33
method | result | size |
risch | \(\frac {49 a^{4} x}{16}+\frac {11 a^{4} \sin \left (d x +c \right )}{2 d}+\frac {a^{4} \sin \left (6 d x +6 c \right )}{192 d}+\frac {a^{4} \sin \left (5 d x +5 c \right )}{20 d}+\frac {15 a^{4} \sin \left (4 d x +4 c \right )}{64 d}+\frac {3 a^{4} \sin \left (3 d x +3 c \right )}{4 d}+\frac {127 a^{4} \sin \left (2 d x +2 c \right )}{64 d}\) | \(107\) |
derivativedivides | \(\frac {a^{4} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )+\frac {4 a^{4} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+6 a^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {4 a^{4} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+a^{4} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(169\) |
default | \(\frac {a^{4} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )+\frac {4 a^{4} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+6 a^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {4 a^{4} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+a^{4} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(169\) |
norman | \(\frac {\frac {49 a^{4} x}{16}+\frac {207 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}+\frac {1471 a^{4} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {1967 a^{4} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}+\frac {1617 a^{4} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}+\frac {833 a^{4} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {49 a^{4} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {147 a^{4} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {735 a^{4} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {245 a^{4} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {735 a^{4} x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {147 a^{4} x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {49 a^{4} x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}\) | \(238\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 165, normalized size = 1.30 \begin {gather*} \frac {256 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a^{4} - 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4} - 1280 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{4} + 180 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4} + 240 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4}}{960 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.44, size = 89, normalized size = 0.70 \begin {gather*} \frac {735 \, a^{4} d x + {\left (40 \, a^{4} \cos \left (d x + c\right )^{5} + 192 \, a^{4} \cos \left (d x + c\right )^{4} + 410 \, a^{4} \cos \left (d x + c\right )^{3} + 576 \, a^{4} \cos \left (d x + c\right )^{2} + 735 \, a^{4} \cos \left (d x + c\right ) + 1152 \, a^{4}\right )} \sin \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 434 vs.
\(2 (121) = 242\).
time = 0.46, size = 434, normalized size = 3.42 \begin {gather*} \begin {cases} \frac {5 a^{4} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 a^{4} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {9 a^{4} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {15 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {9 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a^{4} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {5 a^{4} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {9 a^{4} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {a^{4} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {5 a^{4} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {32 a^{4} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {5 a^{4} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac {16 a^{4} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {9 a^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {8 a^{4} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {11 a^{4} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} + \frac {4 a^{4} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {15 a^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {4 a^{4} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {a^{4} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + a\right )^{4} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 106, normalized size = 0.83 \begin {gather*} \frac {49}{16} \, a^{4} x + \frac {a^{4} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac {a^{4} \sin \left (5 \, d x + 5 \, c\right )}{20 \, d} + \frac {15 \, a^{4} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac {3 \, a^{4} \sin \left (3 \, d x + 3 \, c\right )}{4 \, d} + \frac {127 \, a^{4} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {11 \, a^{4} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.85, size = 121, normalized size = 0.95 \begin {gather*} \frac {49\,a^4\,x}{16}+\frac {\frac {49\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{8}+\frac {833\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{24}+\frac {1617\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{20}+\frac {1967\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{20}+\frac {1471\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24}+\frac {207\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________